home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-19 | 13.5 KB | 363 lines | [TEXT/MPS ] |
- RELEASE NOTES FOR MPW GCC 2.3.3r12
-
- ***WARNING***
- THIS IS A PRE-RELEASE INTENDED FOR EXPERIMENTATION AND EVALUATION ONLY!
- THERE ARE KNOWN TO BE CODE GENERATION BUGS INVOLVING PASCAL-DECLARED FUNCTIONS
- THAT WILL TRASH THE STACK AND EVERYTHING ELSE!
- ***WARNING***
-
- INSTALLATION
-
- [this is inaccurate and will change anyway]
- To install GCC, set the current directory to the distribution gcc directory (which is
- most likely the directory you got these notes from). Execute
- the script "InstallGCC". You will be asked for the directory you want the
- tools (cc1_<xxx>, cpp_<xxx>, gcc_driver, shorten) to be placed.
- Then you will be asked for the directory you
- want the scripts (gC, gCPlus) to be placed. The default directories are
- {MPW}Tools: and {MPW}Scripts: respectively.
- [describe options to InstallGCC eventually]
-
- CHANGING THE SHELL
-
- The MPW partition size will need to be rather large; 3000K is often enough,
- but the exact value will depend on the size and complexity of what you're compiling.
- [what is the min needed for self-compilation? would be a good standard]
-
- ************* DO THIS!! ************----- -----*********** DO THIS!! ************
- \ /
- \/
- Also, the MPW stack MUST BE INCREASED to 128K. This is done by editing the HEXA 128
- resource of the shell to be "0002 0000" (it's normally "0001 0000"). If you neglect
- this, GCC will quite likely overflow the stack and crash your Mac in some mysterious
- way. /\
- / \
- ************* DO THIS!! ************----- -----*********** DO THIS!! ************
-
- (This is because GCC makes heavy use of a "true alloca" that does temporary
- allocation on the stack; very efficient, but sometimes uses huge amounts
- of stack space. We haven't yet encountered any program for which GCC needed more
- than 128K of stack, but your mileage may vary. Note that this is not a problem
- for GCC when compiled by MPW C (the "Stage 1" build); it uses a "fake alloca" based
- on malloc and frame pointer trickery.)
-
- INSTALLING THE DOCUMENTATION
-
- The help files GCC.Help may be appended to MPW.Help, or else accessed using the
- -f option to help. There are Commando resources in the scripts as well.
-
- The Manual-≈ directories contain the long manuals.
-
- CCCP (the preprocessor) and GCC each have their own manuals which are in TeX format.
- Both the commercial Mac application Textures and the shareware program
- OzTeX can format and print the manuals, as long as the TeX macro file texinfo.tex
- (also in Manual-Texi) is available. TeX is also available on many other machines.
-
- If you don't have TeX, the TeX input files ≈.texi are readable, if somewhat ugly.
-
- USING GCC
-
- This GCC port has been designed to fit as smoothly as possible into the MPW
- environment. Once GCC has been installed, you need only change the name of
- the C compiler from "C" to "gC". All of the usual MPW include files and libraries
- should work exactly the same as with MPW C; please let me know when they don't!
-
- There are some known differences between GCC and MPW C:
-
- * Some MPW C options are not implemented by GCC. See GCC.Help for the exact list
- of what is available. Any options not listed are not supported.
-
- * All GCC options are CaSe SeNsItIvE! MPW C-compatible options must always be
- all-lower-case in GCC.
-
- * The dump and load pragmas are not supported. Their presence will
- not cause an error however.
-
- * The preprocessor symbol __DUMP__ is always undefined.
-
- * The preprocessor symbol __SEG__ cannot be used to set the segment.
-
- * The preprocessor symbol "mpwgcc" is defined.
-
- * The "comp" type is recognized and has code generated for it, but the
- library routines are presently undefined.
-
- * -sym options are just passed on to the MPW assembler, so source-level debuggers won't be
- that useful with your code.
-
- * -mbg ch8 and -mbg <number> are not implemented.
-
- * Since GCC produces code that is processed by the MPW Assembler, any C symbols
- that are the same as the names of 68xxx registers (d0, sp, caar, etc) must be
- changed to something else. GCC will postpend an underscore (_) and issue a warning
- that this is being done. If all of your program is being compiled by GCC, there
- shouldn't be any problems, but if you mix MPW C and GCC code, then you may get
- linker errors, and must modify your source code to use different symbols.
-
- * GCC will often issue library calls to handle operations such as multiplies and
- block moves. If you don't link in libraries like StdCLib.o and Runtime.o, you may
- get complaints from the linker that certain functions are undefined, even though
- you don't call them explicitly in the source code.
-
- * A number of MPW bugs and sloppinesses are missing from GCC. Although this is
- generally good, you may find that GCC complains about a number of situations that
- MPW accepts silently.
-
- * A common instance of this is when GCC complains about
- void foo(short); ... void foo(x) short x; { ... }
- This really is incorrect code, but MPW won't complain. GCC has been changed to
- only issue a warning rather than an error in these cases, but you can expect to
- see a lot of these.
-
- * Another important example is the -n flag, which doesn't just convert pointer
- usage errors into warnings, it actually silences MPW C entirely! This can lead
- to serious pointer arithmetic mistakes being accepted, including ones that GCC
- cannot possibly deal with.
-
- ADDITIONAL FEATURES OF GCC
-
- There are dozens of additional options and features in GCC, which I will only
- summarize here. See the GCC.Help file for short cryptic descriptions of the command
- options and the GCC manual for long elaborate explanations. Also, the Commando
- interface is a convenient tour of all the options.
-
- GCC also features additional language constructs that are unique to it.
- These constructs include statements and declarations inside of
- expressions, named expression type, typeof, alignof, generalized lvalues, arrays of
- variable length, nonconstant initializers, constructor expressions, function
- inlining, and inline assembly code. Note that these nice new constructs are
- not in MPW C, which will usually fail on them; the gC option -pedantic will
- issue warnings when any of these appear in your code. If you really really want
- to use these but also want to have portable code, they should be ifdefed.
-
- Additional GCC command options include the ability to generate assembly language output,
- optional optimization, a number of controls over warning messages, and a number of
- controls over compilation technique.
-
- Optimization in GCC is extremely good. On the 680x0, GCC will do excellent
- register allocation, in addition to maximally exploiting addressing modes.
- (A dramatic example is the inner loop of Mandelbrot calculation - GCC will use
- all eight FPx registers for temporaries.) It does tend to favor code speed
- over size. Some parts of the Mac interface are done awkwardly and/or slowly
- (such as non-68881 SANE calls and pascal returns).
-
- USING C++
-
- The script gCPlus is an approximate implementation of MPW C++. It works by
- running CFront with options set to produce text output, then invoking gC on
- the result. MPW C++ and C++ in general are moving targets, so you're more likely
- to run into incompatibilities and other problems (static constructors and
- destructors are sometimes a hassle, for instance).
-
- FURTHER READING
-
- Both the compiler and preprocessor have their own manuals, which are in TeX
- format. [describe or xref how to print these]
-
- The most useful parts are those describing the extra command options in detail
- (since the manual was written for Unix GCC, many of the option names are different,
- so watch out), and the sections describing GCC's extensions to C.
-
- IF gC CRASHES
-
- When the compiler runs into trouble, it will generally calls fancy_abort, which goes
- into Macsbug. "g" usually gets you back to MPW safely. This should never occur for
- the standard compiler; please report any occurrences, ideally including the source
- file and command options responsible. GCC may occasionally produce code that the
- MPW Assembler will choke on; again, this shouldn't happen and should be reported
- when it does. As a convenience when this happens, gC will leave the asm file
- around rather than deleting it.
-
- Known problems with GCC are listed below. Fixes and/or suggestions
- to solve any of these problems will be gratefully accepted and incorporated into
- future releases of MPW GCC.
-
- ROAD MAP
-
- The GCC source tree is huge. Fortunately, much of it is documentation and
- support for obscure systems. The Unix version puts everything in one
- main directory and just a couple subdirectories. This does not work
- well on the Mac, so MPW GCC uses an organization with many more
- subdirectories.
-
- The basic distribution includes the following items.
-
- :Release Notes This document.
-
- :Install Installer script for MPW GCC.
-
- :Scripts: Scripts for using MPW GCC.
-
- :Tools: Tools invoked by the scripts.
-
- :GCC.Help MPW-style command option help.
-
- :Documents: Essential FSF GCC documents.
-
- :Manual-DVI: Manuals for GCC and CPP, in DVI form.
-
- :Manual-Info: Manuals for GCC and CPP, in Info File form.
-
- :Manual-Texi: Texinfo sources for GCC and CPP manuals.
-
- The following directories are only included with the basic source distribution.
-
- :Build: Scripts used to build all versions of MPW GCC.
-
- :Sources: All non-language-specific sources.
-
- :Sources-Apple: Files added by Apple.
-
- :Sources-C: C frontend sources.
-
- :Sources-CPlus: C++ frontend sources.
-
- :Targets: All the target machines.
-
- :Targets:<xxx>: All the sources for target machine xxx.
-
- :Tests: A set of test cases and small benchmarks.
-
- The following directories are only included with the full source distribution.
-
- :ChangeLogs: Full FSF change logs.
-
- :Documents-Misc: Random document files, mostly irrelevant to the Mac.
-
- :Misc: This contains miscellaneous things, mostly scripts for
- Unix, VMS, and MS-DOS.
-
- :Sources-Misc: Miscellaneous sources not used in MPW GCC,
- mostly sources for tools that are only useful in Unix.
-
- :Sources-ObjC: Objective C frontend sources.
-
- :Sources-Targets: All the sources for machine targets.
-
- The following directories are not normally distributed, but are constructed
- automatically during builds.
-
- :Stage[1234]-<xxx>: These are for the different stages and target machines
- needed during the build process.
-
-
- KNOWN BUGS
-
- Some of the descriptions below are garbled, sorry.
-
- The compiler generates bad code for some pascal-declared calls.
- (return size is wrong with prototype for non-long sizes
- pushes and pulls bytes off stack wrong
- pascal typedef globals (values) aren't coming out as pascal type (not uppercase))
-
- Command-line arguments should be allowed to be in any case.
-
- Terrible junk is created by saving/restoring about ULMULT and friends.
-
- Multiple levels of function inlining seems to defeat frame pointer omission.
-
- gCPlus is still a script rather than driver-based, slows it down.
-
- Should detect and warn if FPU not present, instead of crashing mysteriously.
-
- Initializing a local variable that is a structure makes global data
- when it would be better not to.
-
- Data copying should use an inline dbra loop rather than calling memcpy
- always (should be selectable actually).
-
- Some Unix-syntax options are rejected unnecessarily.
-
- Need an option to return shorts instead of ints from functions declared to
- return shorts - similarly to what happens when a function is declared "pascal",
- but without the other effects.
-
- Very long direct fns may exceed 25-arg limit on DC.Ws in asm code.
-
- When -finline-functions is used, not all needed symbols are created
- and imported.
-
- Some sorts of conversions (such as double <-> extended) cause a crash in
- the reload phase. Seems to be more common with optimization+SANE+extended
- floats, but has been observed in other situations also.
- Example (OK with -mc68881, fails without):
- int n, i, arr[10];
- float c, theta, tang;
- test() {
- for (i = 0; i < n; i++) {
- tang = atan2 (cos (i * 2.0), sin (i * 2.0));
- arr[i] = 50 * c * sin (tang); }}
- Workaround: temp variables and multiple assignment statements seem to help.
-
- #<symbol> sometimes appears as an operand (as when pointer arithmetic is being
- done on the address of an array), causing MPW Asm to report an error.
- Example:
- extern char gline[100], *fooline;
- foo() { return fooline - gline; }
- Workaround: assign address to a temp pointer, then do operations on value of ptr.
-
- Casted objects passed by address to pascal functions don't get converted.
-
- Pointer to a function does not have the right sort of value
- Example:
- void f();
- void (*fp)() = f;
- foo() { return *fp == f; } /* returns 0, but should return 1 */
-
- (Incorrect code gen for C code defined as pascal fn returning structs?)
-
- Complains about mismatches between ptrs to chars and unsigned chars
- (Mac read() proto vs cccp.c, for instance).
-
- CHANGE LOG
-
- 2.3.3r10:
-
- Fixed bug with multiple -i options.
-
- Fixed -opt branch bugs that lost real asm errors,
- and fixed to not spin on negative line numbers from asm.
-
- Hacked randomly on "symbols as address constants" handling.
-
- 2.3.3r9:
-
- Added talking compiler silliness.
-
- Fixed interaction between -b option and segment stuff.
-
- 2.3.3r8:
-
- 2.3.3r7:
-
- 2.3.3r6:
-
- Changed handling of pascal and parameter pragmas; they now create distinct
- function types.
-
- Simplified and streamlined many of the patches, while keeping them
- semantically equivalent.
-
- 2.3.3r5:
-
- Added PowerPC target.
-
- Folded in Brent's r4 changes.
-
- Much reorganization and renaming, in directories, files and scripts.
- Added a top-level BuildGCC script and made InstallGCC capable of
- forcing a build if desired.
-
- 2.3.3r4:
-
- Hacks to make cc1plus work.
-
- 2.3.3r3:
-
- (Never existed?)
-
- 2.3.3r2:
-
- 2.3.3:
-
- First port of 2.3.3 to the Mac.